<?php
include 'mysql_connect.php';

$username = $_POST["user"];
$password = $_POST["pass"];
$firstName = $_POST["first_name"];
$lastName = $_POST["last_name"];
$email = $_POST["email_address"];
$checkBox = $_POST["skill"];


$sql = mysql_query("INSERT INTO username_info values ('$username', '$password', '$firstName','$lastName', '$email')");

$r = mysql_query($sql);

    $checkBox = $_POST["skill"];
    echo $checkBox;
    for($i=0; $i<sizeof($checkBox); $i++){
        $query = "INSERT INTO skills(username, skills) values('$username', '".$checkBox[$i]."')";
        echo $checkBox[$i];
        mysql_query($query) or die(mysql_error());
    }

    /*foreach($_POST['checkbox'] as $checkbox){
        echo $checkbox . ' ';
    } */

echo "Account Created";
header('Location: http://findmyeteam.phpfogapp.com/');
?>